package org.devastra.arcinspect.core.util;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class FileUtil {

	/** 
	 * Reads the file and returns a list of lines
	 * 
	 * @param _file
	 * @return
	 * @throws IOException
	 */
	public static List<String> getLines(File _file) throws IOException {
		List<String> lines = new ArrayList<String>();
		BufferedReader br = null;
		
		try {
			br = new BufferedReader(new FileReader(_file));
			while(br.ready()) {
				lines.add(br.readLine());
			}
		} finally {
			if(br!= null) {
				br.close();
			}
		}
		
		return lines;
	}

}
